<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <title>Login Page</title>
    </h:head>
    <h:body>
        <ui:composition template="./templateguest.xhtml">
            <ui:define name="center">
                <h:form id="formid">
                   <p:growl id="growl" showDetail="true" sticky="true" />
                   
                    <p:panel header="Login Form">
                        <p:panelGrid columns="2">
                            <p:outputLabel for="usernameInput" value="Username"/>
                            <p:inputText id="usernameInput" value="#{loginBean.username}" />
                            <p:outputLabel for="passwordInput" value="Password"/>
                            <p:password id="passwordInput" value="#{loginBean.password}" />
                            
                        </p:panelGrid>
                        
                        <p:toolbar style="margin-top: 20px">
                            <p:toolbarGroup align="left">
                                <p:commandButton value="Login" update="growl"
                                             action="#{loginBean.login()}" />
                            </p:toolbarGroup>
                        </p:toolbar>
                    </p:panel>
                   
                   <p:toolbar style="margin-left: 15px;margin-top: 15px;margin-right: 20px;">
                        <p:toolbarGroup align="left" style="padding-top: 10px;padding-left: 10px">
                            <p:outputLabel value="If you're not registered, click the following button to join MeteoCal!"/>
                        </p:toolbarGroup>
                        <p:toolbarGroup align="right">
                            <p:commandButton value="Register" action="register?faces-redirect=true" immediate="true"/>
                        </p:toolbarGroup>
                    </p:toolbar>
                </h:form>

            </ui:define>
        </ui:composition>
    </h:body>
</html>

